.fancy-loading {
  /* 遮罩层强制充满屏幕并居中 */
  .el-loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(20, 28, 52, 0.9), rgba(72, 52, 212, 0.7));
    backdrop-filter: blur(6px);
    z-index: 2000; /* 确保在最上层 */
  }

  /* 加载器容器 */
  .el-loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto; /* 辅助居中 */

    /* 移除默认图标 */
    .el-icon-loading {
      display: none;
    }

    /* 外层旋转环 */
    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      border: 4px solid transparent;
      border-top-color: #a29bfe;
      border-bottom-color: #4834d4;
      border-radius: 50%;
      animation: spin 1.2s ease-in-out infinite;
    }

    /* 内层核心 */
    &::after {
      content: '';
      position: absolute;
      width: 20px;
      height: 20px;
      background: radial-gradient(circle, #fff, #a29bfe);
      border-radius: 50%;
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
      animation: breathe 1.5s ease-in-out infinite;
    }
  }

  /* 文字样式 */
  .el-loading-text {
    position: absolute;
    top: calc(100% + 20px); /* 相对于加载器底部 */
    left: 50%;
    transform: translateX(-50%); /* 水平居中 */
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(162, 155, 254, 0.5);
    animation: textFade 1.8s ease-in-out infinite;
  }
}

/* 备用方案：如果 flex 失效，使用绝对定位 */
.fancy-loading .el-loading-spinner {
  /* 如果 flex 不生效，强制居中 */
  @media (max-width: 9999px) {
    /* 覆盖默认样式 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

/* 动画定义 */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes textFade {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
